<?php $this->Html->css('/css/contact', array("inline" => false));?>
<?php echo $this->element('sub_menu'); ?>
<div class="container mt-10 aboutus-page">
    <div class="row">
      <h2 class="main-title text-center mt-20 mb-20"><?php echo __('how to find us')?></h2>
      <div class="contact-block cf mb-50">
        <div class="col-xs-12 col-sm-5 col-md-5">
          <div class="map-block">
            <a target="_blank" href="https://www.google.com/maps/place/232+C%E1%BB%99ng+H%C3%B2a,+12,+T%C3%A2n+B%C3%ACnh,+H%E1%BB%93+Ch%C3%AD+Minh,+Vietnam/@10.8028981,106.6500914,17z/data=!3m1!4b1!4m2!3m1!1s0x31752947d5dce1c7:0xa1df2979ea0ce59b?hl=en">
                <img src="/images/about/img_map.png" alt="" class="img-responsive" />
            </a>
          </div><!-- /map-block -->
        </div>

        <div class="col-xs-12 col-sm-7 col-md-7">
          <div class="address-box">
            <p><?php echo __('CONTACT_TEXT');?></p>
            <div class="w270 mt-15">
              <p class="br-dt-01 pt-10 pb-10"><span><?php echo __('Address');?></span><br />
                <?php echo $contact['Contact']['address'];?></p>

              <p class="br-dt-01 pt-10 pb-10"><span>Email</span><br />
                <?php echo $contact['Contact']['email'];?></p>

              <p class="br-dt-01 pt-10 pb-10"><span><?php echo __('Telephone')?></span><br />
                <?php echo $contact['Contact']['phone'];?> - Hotline : <?php echo $contact['Contact']['hotline'];?></p>

              <p class="pt-10 pb-10"><span>Fax</span><br />
                <?php echo $contact['Contact']['fax'];?></p>
            </div>

          </div>
        </div>
      </div><!-- /contact-block -->

      <h2 class="clear main-title text-center pt-30"><?php echo __('Feedback')?></h2>
      <div class="contact-block cf mb-50">
        <div class="col-xs-12 col-sm-12 col-md-12">
          <form class="form-horizontal contact-form" role="form">
          
          </form>
          <form id="frm-contact" class="form-horizontal contact-form" role="form" method="post" action="/contacts/send_email">
            <p id="error" class="text-danger" style="display:none"></p><br />
            <div class="form-group col-md-6 mb-25">
              <input class="form-control" type="text" name="name" id="name" placeholder="<?php echo __('Name')?> (*)">
            </div>
            <div class="form-group col-md-6 mb-25">
              <input class="form-control" type="text" name="email" id="email" placeholder="Email (*)">
            </div>
            <div class="form-group col-md-6 mb-25">
              <input class="form-control" type="text" name="company" id="company" placeholder="<?php echo __('Company')?>">
            </div>
            <div class="form-group col-md-6 mb-25">
              <input class="form-control" type="text" name="telephone" id="telephone" placeholder="<?php echo __('Telephone')?>">
            </div>
            <div class="form-group col-md-12">
              <textarea class="form-control" name="message" id="message" cols="30" rows="10" placeholder="<?php echo __('Message')?> (*)"></textarea>
            </div>
            <div class="form-group align-center">
              <button type="button" class="btn btn-block" id="send"><?php echo __('Send')?></button>
              <button type="button" class="btn btn-clear" id="clear"><?php echo __('Clear')?></button>
            </div>
          </form>
        </div>
      </div><!-- /contact-block -->
    </div>
</div>
<script>
$(document).ready(function(){
    $('#send').click(function(){
        var name = $('#name').val();
        var email = $('#email').val();
        var message = $('#message').val();
        var pattern=/^([a-zA-Z0-9_.-])+@([a-zA-Z0-9_.-])+\.([a-zA-Z])+([a-zA-Z])+/;

        if(name == '' || email== '' || message=='') {
            $('#error').html('<?php echo __("Please input required fields.")?>').attr('style','color:red').show();
            return;
        } else if(!pattern.test(email)) {
            $('#error').html('<?php echo __("Email not valid.")?>').attr('style','color:red').show();
            $('#email').focus();
            return;
        }
    
        $('#frm-contact').submit();
    });
    
     $('#clear').click(function(){
        $('#name').val('');
        $('#email').val('');
        $('#message').val('');
        $('#name').focus();
        return;
     });
});
</script>